import { CommonEntity } from 'src/common/entities/common.entity';
import { Tag } from 'src/modules/tag/entities/tag.entity';
import { Entity, Column, ManyToMany, JoinTable } from 'typeorm';

@Entity()
export class Article extends CommonEntity {
  @Column('text')
  title: string;

  @Column('text')
  description: string;

  @Column('text')
  content: string;

  @ManyToMany(() => Tag, (tag) => tag.articles)
  @JoinTable()
  tags?: Tag[];
}
